package cn.softgame.jserver.application.connection;

import java.io.InputStream;
import java.util.Properties;

/**
 * 服务器参数配置
 * @author xuquan
 * 日期:2013-5-28
 */
public class ServerCfg {
	private static int tcpPort=81;
	private static int udpPort=82;
	
	public int getTcpPort(){
		return tcpPort;
	}
	
	public int getUdpPort(){
		return udpPort;
	}
	
	private void getConfig(){
		InputStream is = null;
		try{
			Properties prop = new Properties();
			is = getClass().getClassLoader().getResourceAsStream("config.properties");
			prop.load(is);
			
			String portStr = prop.getProperty("server.tcpPort");
			tcpPort = Integer.parseInt(portStr.trim());
			
			portStr = prop.getProperty("server.udpPort");
			udpPort = Integer.parseInt(portStr.trim());
			
			is.close();
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
